//
//  UILabel+CXLabel.m
//  智积分
//
//  Created by apple on 2018/5/15.
//  Copyright © 2018年 Cynic. All rights reserved.
//

#import "UILabel+CXLabel.h"

@implementation UILabel (CXLabel)


+(id)CXCreateLabelwithFrame:(CGRect)labelframe withtTitle:(id)labelTitle inColor:(UIColor *)bgcolor withHasBottomLayer:(BOOL)hasbottomlayer withbottomlayerHit:(CGFloat)layerhit withBottomLayercolor:(UIColor *)bottomlayercolor withLabelfont:(CGFloat)fontsize withlabelTextColor:(UIColor *)textColor withReturnLabel:(BOOL)hasRetuen beyoundview:(id)parentview{
    UILabel *label = [[UILabel alloc] initWithFrame:labelframe];
    label.text = labelTitle;
    label.backgroundColor = bgcolor;
    label.textColor = textColor;
    label.font = [UIFont systemFontOfSize:fontsize];
    if (hasbottomlayer) {
        UIView *bottomlayer = [[UIView alloc]initWithFrame:CGRectMake(labelframe.origin.x, labelframe.origin.y + labelframe.size.height, labelframe.size.width, layerhit)];
        bottomlayer.backgroundColor = bottomlayercolor;
        [parentview addSubview:bottomlayer];
    }
    if (parentview) {
        [parentview addSubview:label];
    }
    if (hasRetuen) {
        return label;
    }
    else{
    return nil;
    }
}
@end
